<%@ page import= "model.filemanager.UserQuota" %>
<%@ page import= "model.filemanager.FileManager" %>
<%@ page import= "view.MediaFormatter" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import ="com.google.appengine.api.users.UserService" %>
<%@ page import ="com.google.appengine.api.users.UserServiceFactory" %>
	<% 	
		UserService userService = UserServiceFactory.getUserService();
		User user = userService.getCurrentUser();
		FileManager fm = new FileManager(user.getEmail());
		UserQuota uq = new UserQuota(user.getEmail());
	%>
	<div id="contentDiv">
		<h1>Vault Statistics</h1>
		<table id="statstable">
			<tr><td>Number of Audio Files</td><td><%= uq.getNumberOfFiles("audio") %></td></tr>
			<tr><td>Number of Image Files</td><td><%= uq.getNumberOfFiles("image") %></td></tr>
			<tr><td>Number of Video Files</td><td><%= uq.getNumberOfFiles("video") %></td></tr>
			<tr><td>Total Number of Files</td><td><%= uq.getNumberOfFiles(null) %></td></tr>
			<tr><td>Size of Audio Files</td><td><%= MediaFormatter.FormatFileSize(uq.getTotalStorage("audio")) %></td></tr>
			<tr><td>Size of Image Files</td><td><%= MediaFormatter.FormatFileSize(uq.getTotalStorage("image")) %></td></tr>
			<tr><td>Size of Video Files</td><td><%= MediaFormatter.FormatFileSize(uq.getTotalStorage("video")) %></td></tr>
			<tr><td>Total Size of Files</td><td><%= MediaFormatter.FormatFileSize(uq.getTotalStorage(null))  %></td></tr>
			<tr><td>Quota Used</td><td><%= String.format("%.2f%% (out of %s)", 100.0 * (uq.getTotalStorage(null))/(double)uq.maximumBytes, MediaFormatter.FormatFileSize(uq.maximumBytes)) %></td></tr>
		</table>
	</div>
